using System.Windows.Forms;
using CloudShot.Editor.CanvasFigures;
using CloudShot.Interfaces;

namespace CloudShot.Editor.Tools
{
  /// <summary>
  ///   Ellipse tool
  /// </summary>
  internal sealed class EllipseTool : RectangleTool
  {
    public EllipseTool(IDrawingCanvas drawingCanvas, FigureSettings figureSettings, Section changeToolsSection, Section resetToolSection, Cursor cursor)
      : base(drawingCanvas, figureSettings, changeToolsSection, resetToolSection, cursor) { }

    public override void OnMouseDown(MouseEventArgs e)
    {
      var ellipse = new CanvasEllipse(e.X, e.Y, 1, 1)
      {
        BorderColor = FigureSettings.BorderColor,
        BackColor = FigureSettings.BackColor,
        BorderWidth = FigureSettings.BorderWidth,
        BackgroundOpacity = FigureSettings.BackgroundOpacity,
        LineType = FigureSettings.LineType
      };

      AddNewObject(Canvas, ellipse);
    }
  }
}